package org.smart.framework.core.bean;

import org.smart.framework.core.util.CastUtil;

import java.util.Map;

/**
 * @author lyric
 * @version 1.0.0
 * @date 2017/2/9 10:55
 * @description 请求参数对象
 */
public class    Param {

    /** 参数对象 */
    private Map<String, Object> paramMap;

    /**
     * @author lyric
     * @description 带参构造函数
     * @param paramMap 参数对象
     */
    public Param(Map<String, Object> paramMap) {
        this.paramMap = paramMap;
    }

    /**
     * @author lyric
     * @description 根据参数名获取 long 参数
     * @param name 参数名
     * @return
     */
    public long getLong(String name) {
        return CastUtil.castLong(paramMap.get(name));
    }

    /**
     * @author lyric
     * @description 获得参数对象
     * @return
     */
    public Map<String, Object> getParamMap() {
        return paramMap;
    }
}
